﻿CREATE PROCEDURE [dbo].[proc_Assets_GetItem]
	(
		@GId uniqueidentifier
	)
AS
	Select
	a.Id,
	a.GId,
	a.CategoryId,
	(Select Title From Assets_Categorys Where Id=a.CategoryId) As CategoryName,
	NameId,
	(Select Title From Assets_Names Where Id=a.NameId) As NameTitle,
	Description,
	CompanyId,
	(Select CompanyName From Company Where Id=a.CompanyId) As CompanyName,
	DepartmentId,
	(Select DName From Department Where Id=a.DepartmentId) As Department,
	UserName,
	EName,
	StateId,
	(Select Title From Assets_States Where Id=a.StateId) As StateName,
	Prices,
	DJUserName,
	DJDate,
	GGXH,
	GZDate,
	LyDate,a.oldEName,Anumber
	From Assets a Where a.GId=@GId
	RETURN
